package com.wzz.first.TopicSomething;

import org.apache.activemq.ActiveMQConnectionFactory;

import javax.jms.*;

public class TopicProducer {
    public static void main(String[] args) throws JMSException {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://192.168.1.47:61616");
        Connection connection = factory.createConnection();
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic topicOne = session.createTopic("topicOne");
        MessageProducer producer = session.createProducer(topicOne);
        TextMessage topic = session.createTextMessage("topic");
        producer.send(topic);
    }
}
